#############################################################################
##
## Copyright (C) 2006-2006 Mindcast Productions. All rights reserved.
##
## This file is part of the Universal SQL Navigator - UniSQLNav.
## Find more information in: http://code.google.com/p/unisqlnav/
## Contact at carlosedp@gmail.com
##
## This file may be used under the terms of the GNU General Public
## License version 2.0 as published by the Free Software Foundation
## and appearing in the file LICENSE.GPL included in the packaging of
## this file.  Please review the following information to ensure GNU
## General Public Licensing requirements will be met:
## http://www.gnu.org/licenses/gpl.txt
##
## This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
## WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
##
## $Rev: $
## $Date:  $
##
#############################################################################

from PyQt4 import QtGui

BACKENDS = {'SQLite3': 'sqlite',
            'Oracle 9i': 'oracle9i'}

BACKEND_FIELDS = {'': ['',],
                  'SQLite3': ['database',],
                  'Oracle 9i': ['database', 'user', 'password'],
                 }
 

class DatabaseException(Exception): 
    """
    Exception for problems accessing the stock database
    """
    def __init__(self, reason):
      Exception.__init__( self )
      self.reason = reason

    def __str__( self ):
        return self.reason

class DBQueryError(Exception): 
    """
    Exception for problems making queries
    """
    def __init__(self, reason):
      Exception.__init__( self )
      self.reason = str(reason)

    def __str__( self ):
        return "Error executing SQL Query:\n\n" + self.reason


